import { zlRequest } from "../index";

// 登录接口
export const userLogin = (data: any) => {
  return zlRequest.post({ url: "/login", showLoading: false, data });
};

// 注册接口
export const userRegister = (data: any) => {
  return zlRequest.post({ url: "/register", showLoading: false, data });
};

// 忘记密码接口
export const editPwd = (data: any) => {
  return zlRequest.post({ url: "/forgetPwd", showLoading: false, data });
}

// 获取用户详情
export const getInfo = () => {
  return zlRequest.get({ url: "/getInfo", showLoading: false });
};

// 获取用户权限
export const getUserAuth = () => {
  return zlRequest.get({ url: "/web/auth/getAuth", showLoading: false })
}

// 请求验证码
export const getPhoneCode = (data: any) => {
  return zlRequest.post({ url: "/sendMsgCode", showLoading: false, data })
}

// 留言板列表
export const getChatList = (params: { userId: string }) => {
  return zlRequest.get({ url: "/system/guestbook/getInfo", showLoading: false, params })
}


// 发送留言
export const sendMsg = (data: { content: string, type: "1" | "2" }) => {
  return zlRequest.post({ url: "/system/guestbook/insertGuestbook", showLoading: false, data })
}


// bind address
export const bindAddressForUser = (data: any) => {
  return zlRequest.post({ url: "/member/member/bindPark", data, showLoading: false })
}
// 修改用户信息
export const editUser = (data: any) => {
  return zlRequest.post({ url: "/system/user/editUser", data, showLoading: false })
}
